Browse Source

Update sord

tags/1.9.7
falkTX 10 years ago
parent
commit
4b305f80fb
10 changed files with 345 additions and 113 deletions
  1. +9
    -3
      source/modules/lilv/sord-0.12.2/NEWS
  2. +1
    -1
      source/modules/lilv/sord-0.12.2/sord.pc.in
  3. +4
    -0
      source/modules/lilv/sord-0.12.2/sord/sord.h
  4. +4
    -1
      source/modules/lilv/sord-0.12.2/sord/sordmm.hpp
  5. +22
    -6
      source/modules/lilv/sord-0.12.2/src/sord.c
  6. +278
    -95
      source/modules/lilv/sord-0.12.2/src/sord_validate.c
  7. +8
    -3
      source/modules/lilv/sord-0.12.2/src/zix/btree.c
  8. +2
    -1
      source/modules/lilv/sord-0.12.2/src/zix/btree.h
  9. BIN
      source/modules/lilv/sord-0.12.2/waf
  10. +17
    -3
      source/modules/lilv/sord-0.12.2/wscript

+ 9
- 3
source/modules/lilv/sord-0.12.2/NEWS View File

@@ -1,9 +1,15 @@
sord (0.13.0) unstable;

* Reduce memory usage and increase performance with a better data structure
* Add sord_erase() for erasing statements via an iterator.

-- David Robillard <d@drobilla.net> Wed, 24 Sep 2014 14:58:49 -0400
* Add sord_erase() for erasing statements via an iterator
* Fix bugs with stores that contain both graphs and default graph statements
* Fix compilation on compilers that do not support -pthread flag
* sord_validate: More extensive validation, including cardinality,
PlainLiteral, and someValuesFrom restrictions.
* This release does not break the ABI, but the semantics of iterators has
changed: any modification to a model invalidates iterators on that model

-- David Robillard <d@drobilla.net> Thu, 19 Feb 2015 23:18:02 -0500

sord (0.12.2) stable;



+ 1
- 1
source/modules/lilv/sord-0.12.2/sord.pc.in View File

@@ -7,5 +7,5 @@ Name: Sord
Version: @SORD_VERSION@
Description: A lightweight C library for storing RDF statements in memory.
Requires: @PKG_serd_0@
Libs: -L${libdir} -l@LIB_SORD@
Libs: -L${libdir} -l@LIB_SORD@ -lserd-0 -lm
Cflags: -I${includedir}/sord-@SORD_MAJOR_VERSION@

+ 4
- 0
source/modules/lilv/sord-0.12.2/sord/sord.h View File

@@ -436,6 +436,8 @@ sord_count(SordModel* model,

/**
Check if `model` contains a triple pattern.

@return true if `model` contains a match for `pat`, otherwise false.
*/
SORD_API
bool
@@ -445,6 +447,8 @@ sord_contains(SordModel* model, const SordQuad pat);
Add a quad to a model.

Calling this function invalidates all iterators on `model`.

@return true on success, false, on error.
*/
SORD_API
bool


+ 4
- 1
source/modules/lilv/sord-0.12.2/sord/sordmm.hpp View File

@@ -596,6 +596,10 @@ Model::write_to_string(const std::string& base_uri_str,
string_sink,
&ret);

const SerdNode base_uri_node = serd_node_from_string(
SERD_URI, (const uint8_t*)base_uri_str.c_str());
serd_writer_set_base_uri(writer, &base_uri_node);

serd_env_foreach(_world.prefixes().c_obj(),
(SerdPrefixSink)serd_writer_set_prefix,
writer);
@@ -647,4 +651,3 @@ Model::get(const Node& subject,
} // namespace Sord

#endif // SORD_SORDMM_HPP


+ 22
- 6
source/modules/lilv/sord-0.12.2/src/sord.c View File

@@ -148,6 +148,9 @@ sord_node_hash(const void* n)
{
const SordNode* node = (const SordNode*)n;
uint32_t hash = zix_digest_start();
if (node->node.buf == NULL) {
return 0;
}
hash = zix_digest_add(hash, node->node.buf, node->node.n_bytes);
hash = zix_digest_add(hash, &node->node.type, sizeof(node->node.type));
if (node->node.type == SERD_LITERAL) {
@@ -207,6 +210,7 @@ free_node_entry(void* value, void* user_data)
sord_node_free((SordWorld*)user_data, node->meta.lit.datatype);
}
free((uint8_t*)node->node.buf);
node->node.buf = NULL;
}

void
@@ -447,14 +451,14 @@ sord_iter_get_node(const SordIter* iter, SordQuadIndex index)
return iter ? ((SordNode**)zix_btree_get(iter->cur))[index] : NULL;
}

bool
sord_iter_next(SordIter* iter)
static bool
sord_iter_scan_next(SordIter* iter)
{
if (iter->end)
if (iter->end) {
return true;
}

const SordNode** key;
iter->end = sord_iter_forward(iter);
if (!iter->end) {
switch (iter->mode) {
case ALL:
@@ -505,6 +509,17 @@ sord_iter_next(SordIter* iter)
}
}

bool
sord_iter_next(SordIter* iter)
{
if (iter->end) {
return true;
}

iter->end = sord_iter_forward(iter);
return sord_iter_scan_next(iter);
}

bool
sord_iter_end(const SordIter* iter)
{
@@ -1194,7 +1209,7 @@ sord_add(SordModel* sord, const SordQuad tup)
memcpy(quad, tup, sizeof(SordQuad));

for (unsigned i = 0; i < NUM_ORDERS; ++i) {
if (sord->indices[i]) {
if (sord->indices[i] && (i < GSPO || tup[3])) {
if (!sord_add_to_index(sord, quad, (SordOrder)i)) {
assert(i == 0); // Assuming index coherency
free(quad);
@@ -1220,7 +1235,7 @@ sord_remove(SordModel* sord, const SordQuad tup)

SordNode* quad = NULL;
for (unsigned i = 0; i < NUM_ORDERS; ++i) {
if (sord->indices[i]) {
if (sord->indices[i] && (i < GSPO || tup[3])) {
if (zix_btree_remove(sord->indices[i], tup, (void**)&quad, NULL)) {
assert(i == 0); // Assuming index coherency
return; // Quad not found, do nothing
@@ -1258,6 +1273,7 @@ sord_erase(SordModel* sord, SordIter* iter)
}
}
iter->end = zix_btree_iter_is_end(iter->cur);
sord_iter_scan_next(iter);

free(quad);



+ 278
- 95
source/modules/lilv/sord-0.12.2/src/sord_validate.c View File

@@ -49,10 +49,16 @@ typedef struct {
SordNode* owl_InverseFunctionalProperty;
SordNode* owl_ObjectProperty;
SordNode* owl_OntologyProperty;
SordNode* owl_Restriction;
SordNode* owl_Thing;
SordNode* owl_cardinality;
SordNode* owl_equivalentClass;
SordNode* owl_minCardinality;
SordNode* owl_onDatatype;
SordNode* owl_onProperty;
SordNode* owl_someValuesFrom;
SordNode* owl_withRestrictions;
SordNode* rdf_PlainLiteral;
SordNode* rdf_Property;
SordNode* rdf_first;
SordNode* rdf_rest;
@@ -61,6 +67,7 @@ typedef struct {
SordNode* rdfs_Literal;
SordNode* rdfs_Resource;
SordNode* rdfs_domain;
SordNode* rdfs_label;
SordNode* rdfs_range;
SordNode* rdfs_subClassOf;
SordNode* xsd_anyURI;
@@ -117,7 +124,7 @@ absolute_path(const uint8_t* path)
#endif
}

static void
static int
error(const char* msg, const SordQuad quad)
{
const char* sep = one_line_errors ? "\t" : "\n ";
@@ -127,6 +134,17 @@ error(const char* msg, const SordQuad quad)
sep, (const char*)sord_node_get_string(quad[SORD_SUBJECT]),
sep, (const char*)sord_node_get_string(quad[SORD_PREDICATE]),
sep, (const char*)sord_node_get_string(quad[SORD_OBJECT]));
return 1;
}

static int
errorf(const char* fmt, ...)
{
va_list args;
va_start(args, fmt);
vfprintf(stderr, fmt, args);
va_end(args);
return 1;
}

static bool
@@ -165,7 +183,7 @@ regexp_match(const uint8_t* pat, const char* str)
#ifdef HAVE_PCRE
// Append a $ to the pattern so we only match if the entire string matches
const size_t len = strlen((const char*)pat);
char* const regx = malloc(len + 2);
char* const regx = (char*)malloc(len + 2);
memcpy(regx, pat, len);
regx[len] = '$';
regx[len + 1] = '\0';
@@ -286,6 +304,27 @@ literal_is_valid(SordModel* model,
return true;
}

/* Check that literal data is related to required type. We don't do a
strict subtype check here because e.g. an xsd:decimal might be a valid
xsd:unsignedInt, which the pattern checks will verify, but if the
literal type is not related to the required type at all
(e.g. xsd:decimal and xsd:string) there is a problem. */
const SordNode* datatype = sord_node_get_datatype(literal);
if (datatype && datatype != type) {
if (!is_descendant_of(
model, uris,
datatype, type, uris->owl_onDatatype) &&
!is_descendant_of(
model, uris,
type, datatype, uris->owl_onDatatype)) {
errorf("Literal `%s' datatype <%s> is not compatible with <%s>\n",
sord_node_get_string(literal),
sord_node_get_string(datatype),
sord_node_get_string(type));
return false;
}
}

// Find restrictions list
SordIter* rs = sord_search(model, type, uris->owl_withRestrictions, 0, 0);
if (sord_iter_end(rs)) {
@@ -331,7 +370,7 @@ literal_is_valid(SordModel* model,

static bool
check_type(SordModel* model,
URIs* uris,
const URIs* uris,
const SordNode* node,
const SordNode* type)
{
@@ -341,9 +380,10 @@ check_type(SordModel* model,
}

if (sord_node_get_type(node) == SORD_LITERAL) {
if (sord_node_equals(type, uris->rdfs_Literal) ||
sord_node_equals(type, uris->xsd_string)) {
if (sord_node_equals(type, uris->rdfs_Literal)) {
return true;
} else if (sord_node_equals(type, uris->rdf_PlainLiteral)) {
return !sord_node_get_language(node);
} else {
return literal_is_valid(model, uris, node, type);
}
@@ -377,6 +417,229 @@ check_type(SordModel* model,
return false;
}

static int
check_properties(SordModel* model, URIs* uris)
{
int st = 0;
SordIter* i = sord_begin(model);
for (; !sord_iter_end(i); sord_iter_next(i)) {
SordQuad quad;
sord_iter_get(i, quad);

const SordNode* subj = quad[SORD_SUBJECT];
const SordNode* pred = quad[SORD_PREDICATE];
const SordNode* obj = quad[SORD_OBJECT];

bool is_any_property = false;
SordIter* t = sord_search(model, pred, uris->rdf_type, NULL, NULL);
for (; !sord_iter_end(t); sord_iter_next(t)) {
if (is_descendant_of(model, uris,
sord_iter_get_node(t, SORD_OBJECT),
uris->rdf_Property,
uris->rdfs_subClassOf)) {
is_any_property = true;
break;
}
}
sord_iter_free(t);

const bool is_ObjectProperty = sord_ask(
model, pred, uris->rdf_type, uris->owl_ObjectProperty, 0);
const bool is_FunctionalProperty = sord_ask(
model, pred, uris->rdf_type, uris->owl_FunctionalProperty, 0);
const bool is_InverseFunctionalProperty = sord_ask(
model, pred, uris->rdf_type, uris->owl_InverseFunctionalProperty, 0);
const bool is_DatatypeProperty = sord_ask(
model, pred, uris->rdf_type, uris->owl_DatatypeProperty, 0);

if (!is_any_property) {
st = error("Use of undefined property", quad);
}

if (!sord_ask(model, pred, uris->rdfs_label, NULL, NULL)) {
st = errorf("Property <%s> has no label\n",
sord_node_get_string(pred));
}

if (is_DatatypeProperty &&
sord_node_get_type(obj) != SORD_LITERAL) {
st = error("Datatype property with non-literal value", quad);
}

if (is_ObjectProperty &&
sord_node_get_type(obj) == SORD_LITERAL) {
st = error("Object property with literal value", quad);
}

if (is_FunctionalProperty &&
sord_count(model, subj, pred, NULL, NULL) > 1) {
st = error("Functional property with several objects", quad);
}

if (is_InverseFunctionalProperty &&
sord_count(model, NULL, pred, obj, NULL) > 1) {
st = error("Inverse functional property with several subjects", quad);
}

if (sord_node_equals(pred, uris->rdf_type) &&
!sord_ask(model, obj, uris->rdf_type, uris->rdfs_Class, NULL) &&
!sord_ask(model, obj, uris->rdf_type, uris->owl_Class, NULL)) {
st = error("Type is not a rdfs:Class or owl:Class", quad);
}

if (sord_node_get_type(obj) == SORD_LITERAL &&
!literal_is_valid(model, uris, obj, sord_node_get_datatype(obj))) {
st = error("Literal does not match datatype", quad);
}

SordIter* r = sord_search(model, pred, uris->rdfs_range, NULL, NULL);
for (; !sord_iter_end(r); sord_iter_next(r)) {
const SordNode* range = sord_iter_get_node(r, SORD_OBJECT);
if (!check_type(model, uris, obj, range)) {
st = error("Object not in property range", quad);
fprintf(stderr, "note: Range is <%s>\n",
sord_node_get_string(range));
}
}
sord_iter_free(r);

SordIter* d = sord_search(model, pred, uris->rdfs_domain, NULL, NULL);
if (d) {
const SordNode* domain = sord_iter_get_node(d, SORD_OBJECT);
if (!check_type(model, uris, subj, domain)) {
st = error("Subject not in property domain", quad);
fprintf(stderr, "note: Domain is <%s>\n",
sord_node_get_string(domain));
}
sord_iter_free(d);
}
}
sord_iter_free(i);

return st;
}

static int
check_instance(SordModel* model,
const URIs* uris,
const SordNode* restriction,
const SordNode* instance)
{
int st = 0;

const SordNode* prop = sord_get(
model, restriction, uris->owl_onProperty, NULL, NULL);
if (!prop) {
return 0;
}

const unsigned values = sord_count(model, instance, prop, NULL, NULL);

// Check exact cardinality
const SordNode* card = sord_get(
model, restriction, uris->owl_cardinality, NULL, NULL);
if (card) {
const unsigned c = atoi((const char*)sord_node_get_string(card));
if (values != c) {
st = errorf("Property %s on %s has %u != %u values\n",
sord_node_get_string(prop),
sord_node_get_string(instance),
values, c);
}
}

// Check minimum cardinality
const SordNode* minCard = sord_get(
model, restriction, uris->owl_minCardinality, NULL, NULL);
if (minCard) {
const unsigned m = atoi((const char*)sord_node_get_string(minCard));
if (values < m) {
st = errorf("Property %s on %s has %u < %u values\n",
sord_node_get_string(prop),
sord_node_get_string(instance),
values, m);
}
}

// Check someValuesFrom
SordIter* sf = sord_search(
model, restriction, uris->owl_someValuesFrom, NULL, NULL);
if (sf) {
const SordNode* type = sord_iter_get_node(sf, SORD_OBJECT);
SordIter* v = sord_search(model, instance, prop, NULL, NULL);
bool found = false;
for (; !sord_iter_end(v); sord_iter_next(v)) {
const SordNode* value = sord_iter_get_node(v, SORD_OBJECT);
if (check_type(model, uris, value, type)) {
found = true;
break;
}
}
if (!found) {
st = errorf("%s has no <%s> values of type <%s>\n",
sord_node_get_string(instance),
sord_node_get_string(prop),
sord_node_get_string(type));
}
sord_iter_free(v);
}
sord_iter_free(sf);

return st;
}

static int
check_class_instances(SordModel* model,
const URIs* uris,
const SordNode* restriction,
const SordNode* klass)
{
// Check immediate instances of this class
SordIter* i = sord_search(model, NULL, uris->rdf_type, klass, NULL);
for (; !sord_iter_end(i); sord_iter_next(i)) {
const SordNode* instance = sord_iter_get_node(i, SORD_SUBJECT);
check_instance(model, uris, restriction, instance);
}
sord_iter_free(i);

// Check instances of all subclasses recursively
SordIter* s = sord_search(model, NULL, uris->rdfs_subClassOf, klass, NULL);
for (; !sord_iter_end(s); sord_iter_next(s)) {
const SordNode* subklass = sord_iter_get_node(s, SORD_SUBJECT);
check_class_instances(model, uris, restriction, subklass);
}
sord_iter_free(s);

return 0;
}

static int
check_instances(SordModel* model, const URIs* uris)
{
int st = 0;
SordIter* r = sord_search(
model, NULL, uris->rdf_type, uris->owl_Restriction, NULL);
for (; !sord_iter_end(r); sord_iter_next(r)) {
const SordNode* restriction = sord_iter_get_node(r, SORD_SUBJECT);
const SordNode* prop = sord_get(
model, restriction, uris->owl_onProperty, NULL, NULL);
if (!prop) {
continue;
}

SordIter* c = sord_search(
model, NULL, uris->rdfs_subClassOf, restriction, NULL);
for (; !sord_iter_end(c); sord_iter_next(c)) {
const SordNode* klass = sord_iter_get_node(c, SORD_SUBJECT);
check_class_instances(model, uris, restriction, klass);
}
sord_iter_free(c);
}
sord_iter_free(r);

return st;
}

int
main(int argc, char** argv)
{
@@ -439,10 +702,16 @@ main(int argc, char** argv)
URI(owl, InverseFunctionalProperty);
URI(owl, ObjectProperty);
URI(owl, OntologyProperty);
URI(owl, Restriction);
URI(owl, Thing);
URI(owl, cardinality);
URI(owl, equivalentClass);
URI(owl, minCardinality);
URI(owl, onDatatype);
URI(owl, onProperty);
URI(owl, someValuesFrom);
URI(owl, withRestrictions);
URI(rdf, PlainLiteral);
URI(rdf, Property);
URI(rdf, first);
URI(rdf, rest);
@@ -451,6 +720,7 @@ main(int argc, char** argv)
URI(rdfs, Literal);
URI(rdfs, Resource);
URI(rdfs, domain);
URI(rdfs, label);
URI(rdfs, range);
URI(rdfs, subClassOf);
URI(xsd, anyURI);
@@ -464,100 +734,13 @@ main(int argc, char** argv)
fprintf(stderr, "warning: Built without PCRE, datatypes not checked.\n");
#endif

SordIter* i = sord_begin(model);
for (; !sord_iter_end(i); sord_iter_next(i)) {
SordQuad quad;
sord_iter_get(i, quad);

const SordNode* subj = quad[SORD_SUBJECT];
const SordNode* pred = quad[SORD_PREDICATE];
const SordNode* obj = quad[SORD_OBJECT];

bool is_any_property = false;
SordIter* t = sord_search(model, pred, uris.rdf_type, NULL, NULL);
for (; !sord_iter_end(t); sord_iter_next(t)) {
if (is_descendant_of(model, &uris,
sord_iter_get_node(t, SORD_OBJECT),
uris.rdf_Property,
uris.rdfs_subClassOf)) {
is_any_property = true;
break;
}
}
sord_iter_free(t);

const bool is_ObjectProperty = sord_ask(
model, pred, uris.rdf_type, uris.owl_ObjectProperty, 0);
const bool is_FunctionalProperty = sord_ask(
model, pred, uris.rdf_type, uris.owl_FunctionalProperty, 0);
const bool is_InverseFunctionalProperty = sord_ask(
model, pred, uris.rdf_type, uris.owl_InverseFunctionalProperty, 0);
const bool is_DatatypeProperty = sord_ask(
model, pred, uris.rdf_type, uris.owl_DatatypeProperty, 0);

if (!is_any_property) {
error("Use of undefined property", quad);
}

if (is_DatatypeProperty &&
sord_node_get_type(obj) != SORD_LITERAL) {
error("Datatype property with non-literal value", quad);
}

if (is_ObjectProperty &&
sord_node_get_type(obj) == SORD_LITERAL) {
error("Object property with literal value", quad);
}

if (is_FunctionalProperty &&
sord_count(model, subj, pred, NULL, NULL) > 1) {
error("Functional property with several objects", quad);
}

if (is_InverseFunctionalProperty &&
sord_count(model, NULL, pred, obj, NULL) > 1) {
error("Inverse functional property with several subjects", quad);
}

if (sord_node_equals(pred, uris.rdf_type) &&
!sord_ask(model, obj, uris.rdf_type, uris.rdfs_Class, NULL) &&
!sord_ask(model, obj, uris.rdf_type, uris.owl_Class, NULL)) {
error("Type is not a rdfs:Class or owl:Class", quad);
}

if (sord_node_get_type(obj) == SORD_LITERAL &&
!literal_is_valid(model, &uris, obj, sord_node_get_datatype(obj))) {
error("Literal does not match datatype", quad);
}

SordIter* r = sord_search(model, pred, uris.rdfs_range, NULL, NULL);
if (r) {
const SordNode* range = sord_iter_get_node(r, SORD_OBJECT);
if (!check_type(model, &uris, obj, range)) {
error("Object not in property range", quad);
fprintf(stderr, "note: Range is <%s>\n",
sord_node_get_string(range));
}
sord_iter_free(r);
}

SordIter* d = sord_search(model, pred, uris.rdfs_domain, NULL, NULL);
if (d) {
const SordNode* domain = sord_iter_get_node(d, SORD_OBJECT);
if (!check_type(model, &uris, subj, domain)) {
error("Subject not in property domain", quad);
fprintf(stderr, "note: Domain is <%s>\n",
sord_node_get_string(domain));
}
sord_iter_free(d);
}
}
sord_iter_free(i);
const int prop_st = check_properties(model, &uris);
const int inst_st = check_instances(model, &uris);

printf("Found %d errors among %d files (checked %d restrictions)\n",
n_errors, argc - 1, n_restrictions);

sord_free(model);
sord_world_free(world);
return 0;
return prop_st || inst_st;
}

+ 8
- 3
source/modules/lilv/sord-0.12.2/src/zix/btree.c View File

@@ -306,12 +306,11 @@ zix_btree_insert(ZixBTree* const t, void* const e)
n = n->children[i];
} else {
// Insert into internal node
zix_btree_ainsert(n->vals, n->n_vals, i, e);
zix_btree_ainsert(n->vals, n->n_vals++, i, e);
break;
}
}

++n->n_vals;
++t->size;

return ZIX_STATUS_SUCCESS;
@@ -358,7 +357,7 @@ zix_btree_rotate_left(ZixBTreeNode* const parent, const uint16_t i)

// Move first child pointer from RHS to end of LHS
if (!lhs->is_leaf) {
lhs->children[lhs->n_vals] = zix_btree_aerase(
lhs->children[lhs->n_vals] = (ZixBTreeNode*)zix_btree_aerase(
(void**)rhs->children, rhs->n_vals, 0);
}

@@ -609,6 +608,11 @@ zix_btree_lower_bound(const ZixBTree* const t,
const void* const e,
ZixBTreeIter** const ti)
{
if (!t) {
*ti = NULL;
return ZIX_STATUS_BAD_ARG;
}

ZixBTreeNode* n = t->root;
bool found = false;
unsigned found_level = 0;
@@ -632,6 +636,7 @@ zix_btree_lower_bound(const ZixBTree* const t,
} else {
++(*ti)->level;
n = n->children[i];
assert(n);
}
}



+ 2
- 1
source/modules/lilv/sord-0.12.2/src/zix/btree.h View File

@@ -17,13 +17,14 @@
#ifndef ZIX_BTREE_H
#define ZIX_BTREE_H

#include <stdbool.h>
#include <stddef.h>

#include "zix/common.h"

#ifdef __cplusplus
extern "C" {
#else
# include <stdbool.h>
#endif

/**


BIN
source/modules/lilv/sord-0.12.2/waf View File


+ 17
- 3
source/modules/lilv/sord-0.12.2/wscript View File

@@ -65,6 +65,17 @@ def configure(conf):
atleast_version='0.18.0', mandatory=True)
autowaf.check_pkg(conf, 'libpcre', uselib_store='PCRE', mandatory=False)

if conf.env.HAVE_PCRE:
if conf.check(cflags=['-pthread'], mandatory=False):
conf.env.PTHREAD_CFLAGS = ['-pthread']
conf.env.PTHREAD_LINKFLAGS = ['-pthread']
elif conf.check(linkflags=['-lpthread'], mandatory=False):
conf.env.PTHREAD_CFLAGS = []
conf.env.PTHREAD_LINKFLAGS = ['-lpthread']
else:
conf.env.PTHREAD_CFLAGS = []
conf.env.PTHREAD_LINKFLAGS = []

# Parse dump options and define things accordingly
dump = Options.options.dump.split(',')
all = 'all' in dump
@@ -190,7 +201,10 @@ def build(bld):

# Utilities
if bld.env.BUILD_UTILS:
for i in ['sordi', 'sord_validate']:
utils = ['sordi']
if bld.env.HAVE_PCRE:
utils += ['sord_validate']
for i in utils:
obj = bld(features = 'c cprogram',
source = 'src/%s.c' % i,
includes = ['.', './src'],
@@ -207,7 +221,8 @@ def build(bld):
autowaf.use_lib(bld, obj, 'SERD')
if i == 'sord_validate':
autowaf.use_lib(bld, obj, 'PCRE')
obj.cflags = '-pthread'
obj.cflags = bld.env.PTHREAD_CFLAGS
obj.linkflags = bld.env.PTHREAD_LINKFLAGS

# Documentation
autowaf.build_dox(bld, 'SORD', SORD_VERSION, top, out)
@@ -215,7 +230,6 @@ def build(bld):
# Man pages
bld.install_files('${MANDIR}/man1', bld.path.ant_glob('doc/*.1'))

bld.add_post_fun(autowaf.run_ldconfig)
if bld.env.DOCS:
bld.add_post_fun(fix_docs)



Loading…
Cancel
Save